package com.smart4soft.stock.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.smart4soft.stock.dao.UserinfoDAO;
import com.smart4soft.stock.pojo.Userinfo;
import com.smart4soft.stock.service.UserInfoService;

@Service ("userInfoService")
public class UserInfoServiceImpl implements UserInfoService {

	@Autowired  
	private UserinfoDAO userInfoDao;  
	
	public void delete(long userID) {
		// TODO Auto-generated method stub
	}

	public Userinfo find(long userID) {
		// TODO Auto-generated method stub
		return null;
	}

	public List<Userinfo> list() {
		// TODO Auto-generated method stub
		return null;
	}

	public void save(Userinfo userInfo) {		
		userInfoDao.save(userInfo);		
	}

	public void update(Userinfo userInfo) {
		// TODO Auto-generated method stub

	}

	public boolean verify(Userinfo userInfo) {
		List<Userinfo> list = userInfoDao.findByExample(userInfo);		
		if(list.size() >0 )
		{
			return true;
		}
		return false;
	}

	public Userinfo find(Userinfo userInfo) {
		List<Userinfo> list =  userInfoDao.findByExample(userInfo);
		if(list.size() >0 )
		{
			return (Userinfo)list.get(0);
		}
		else
		{ return null;
		}
	}

}
